package it.uniroma3.gaia.sama.schemaExchangeGenerator;

import it.uniroma3.gaia.sama.DataExchange;
import it.uniroma3.gaia.sama.SchemaExchange;

public class VerifyCorrectnessResult {

	private SchemaExchange schemaExchange;
	private DataExchange dataExchange;
	private OmomorphismResultEnum result;
	
	public VerifyCorrectnessResult(SchemaExchange schemaExchange,DataExchange dataExchange,OmomorphismResultEnum result) {
		this.dataExchange = dataExchange;
		this.schemaExchange = schemaExchange;
		this.result = result;
	}
	
	public VerifyCorrectnessResult(){
	}
	
	public void setDataExchange(DataExchange dataExchange) {
		this.dataExchange = dataExchange;
	}
	public void setSchemaExchange(SchemaExchange schemaExchange) {
		this.schemaExchange = schemaExchange;
	}
	public void setResult(OmomorphismResultEnum result) {
		this.result = result;
	}
	public OmomorphismResultEnum getResult() {
		if(result == null)
			result = OmomorphismResultEnum.PERFECT_MATCHING;
		return result;
	}
	public SchemaExchange getSchemaExchange() {
		return schemaExchange;
	}
	public DataExchange getDataExchange() {
		return dataExchange;
	}
	
	@Override
	public String toString(){
		StringBuffer result = new StringBuffer();
		result.append("The result of verifyCorrectness about:\n");
		result.append("DataExchange: "+ this.dataExchange.getTgd()+"\n");
		result.append("SchemaExchange: "+this.schemaExchange.getTgd()+"\n");
		result.append("is "+ this.result.toString()+"\n");
		return result.toString();
	}
}
